package org.example.controller;

import dev.langchain4j.service.SystemMessage;
import org.example.service.ConsultantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

@RestController
public class ChatController 
{
	@Autowired
	private ConsultantService consultantService;

	@GetMapping(value = "chat",produces = "text/html;charset=utf-8")	//produces设置字符集
//	@GetMapping(value = "chat")
	public Flux<String> chat(@RequestParam String mes)
	{
		Flux<String> chat = consultantService.chat(mes);
		return chat;
	}
}
